<?php

/**
 * Utilisateur filter form base class.
 *
 * @package    kc_report_proto
 * @subpackage filter
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 29570 2010-05-21 14:49:47Z Kris.Wallsmith $
 */
abstract class BaseUtilisateurFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'prf_id'         => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'usr_login'      => new sfWidgetFormFilterInput(),
      'usr_pwd'        => new sfWidgetFormFilterInput(),
      'usr_societe'    => new sfWidgetFormFilterInput(),
      'usr_prenom'     => new sfWidgetFormFilterInput(),
      'usr_nom'        => new sfWidgetFormFilterInput(),
      'usr_tel_bureau' => new sfWidgetFormFilterInput(),
      'usr_tel_port'   => new sfWidgetFormFilterInput(),
      'usr_tel_fax'    => new sfWidgetFormFilterInput(),
      'usr_courriel'   => new sfWidgetFormFilterInput(),
      'usr_adresse'    => new sfWidgetFormFilterInput(),
      'usr_civilite'   => new sfWidgetFormFilterInput(),
      'usr_titre'      => new sfWidgetFormFilterInput(),
    ));

    $this->setValidators(array(
      'prf_id'         => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'usr_login'      => new sfValidatorPass(array('required' => false)),
      'usr_pwd'        => new sfValidatorPass(array('required' => false)),
      'usr_societe'    => new sfValidatorPass(array('required' => false)),
      'usr_prenom'     => new sfValidatorPass(array('required' => false)),
      'usr_nom'        => new sfValidatorPass(array('required' => false)),
      'usr_tel_bureau' => new sfValidatorPass(array('required' => false)),
      'usr_tel_port'   => new sfValidatorPass(array('required' => false)),
      'usr_tel_fax'    => new sfValidatorPass(array('required' => false)),
      'usr_courriel'   => new sfValidatorPass(array('required' => false)),
      'usr_adresse'    => new sfValidatorPass(array('required' => false)),
      'usr_civilite'   => new sfValidatorPass(array('required' => false)),
      'usr_titre'      => new sfValidatorPass(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('utilisateur_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'Utilisateur';
  }

  public function getFields()
  {
    return array(
      'usr_id'         => 'Number',
      'prf_id'         => 'Number',
      'usr_login'      => 'Text',
      'usr_pwd'        => 'Text',
      'usr_societe'    => 'Text',
      'usr_prenom'     => 'Text',
      'usr_nom'        => 'Text',
      'usr_tel_bureau' => 'Text',
      'usr_tel_port'   => 'Text',
      'usr_tel_fax'    => 'Text',
      'usr_courriel'   => 'Text',
      'usr_adresse'    => 'Text',
      'usr_civilite'   => 'Text',
      'usr_titre'      => 'Text',
    );
  }
}
